package com.fandy.struts.SqlStatement;

public class Client {
 
	public   String  getAll()
	{
		return   "select * from Client";
	}
	
	public   String getClientByID(int ID)
	{
		return  "select * from Client where " +com.fandy.struts.Meta.Client.getClientid()+"="+ID;
	}	
 
	
	public String UpdateByID(int id,com.fandy.struts.Model.Client c)
	{
		
		return "update Client set "+com.fandy.struts.Meta.Client.getAddress()
		+"='" + c.getaddress()+"',"		 
		
		+com.fandy.struts.Meta.Client.getCompanyname()+"='"  + c.getcompanyname()+ "',"
		+com.fandy.struts.Meta.Client.getDepartmentid()+ "='"  + c.getdepartmentid() + "',"
		+com.fandy.struts.Meta.Client.getEmail()+ "='"  + c.getemail() + "',"
		+com.fandy.struts.Meta.Client.getFax()+ "='"  + c.getfax() + "',"
		+com.fandy.struts.Meta.Client.getName()+ "='"  + c.getname()+"'"
		+com.fandy.struts.Meta.Client.getPostcode()+ "='"  + c.getpostcode()+"'"
		+com.fandy.struts.Meta.Client.getRemark()+ "='"  + c.getremark()+"'"
		+com.fandy.struts.Meta.Client.getTel()+ "='"  + c.gettel()+"'"
		+"where "+com.fandy.struts.Meta.Client.getClientid()+"="+id;
		
	}
	
	public String DeleteByID(int id)
	{
		
		return "delete from Client where " + com.fandy.struts.Meta.Client.getClientid() +"="+id;
		
	}
	
	
	
}

